package exteditapp;

/**
 * Common view interface for main module.
 * 
 * It represents graphic user interface for controlling application and also allows user to see what
 * is happening currently by showing progress bars of some processes, display some error and help
 * messages.
 * @author Arturas Smorgun, arturas@smorgun.lt
 * @version 2009.04.21
 */
public abstract class IView extends IListener  {

	/**
	 * Link to controller throw which we are able to control program module.
	 */
	protected IController controller;

	/**
	 * Constructor, which also sets controller for this interface.
	 * @param controller controller, by which we will be able to control module
	 */
	public IView(IController controller){
		this.setController(controller);
	}
	
	/**
	 * Default constructor.
	 */
	public IView(){
	}
	
	/**
	 * Return controller, throw which application control is implemented (we use MVC principle and
	 * are not communicating with Application core module directly.
	 * @return current controller which make us able to control application module
	 */	
	public IController getController(){
		return this.controller;
	}

	/**
	 * Set the value of controller, throw which application control is implemented.
	 * @param mycontroller controller, by which we will be able to control module
	 */
	public void setController(IController mycontroller){
		this.controller = mycontroller;
	}
	
	/**
	 * Method in which display of view for runtime is initialized. Does nothing else.
	 */
	public abstract void init();

}
